package net.projecteuler.problem9;

public class Pythagorean {
	public boolean isPythagoreanTriplet(int a, int b, int c) {
		if(a*a + b*b == c*c) {
			return true;
		}
		return false;
	}
	
	public long productAbc(int sumaOfPythagorean) {
		for (int i = 1; i < sumaOfPythagorean; i++) {
			for (int j = 1; j < sumaOfPythagorean; j++) {
				for (int j2 = 1; j2 < sumaOfPythagorean; j2++) {
					if(i + j + j2 == 1000) {
						if(isPythagoreanTriplet(i, j, j2)) {
							return i * j * j2;
						}
					}
				}
			}
		}
		return -1;
	}
}
